<?php
namespace Home\Controller;
use Think\Controller;
class UserController extends Controller {
	public function index(){
		
    }
	public function user_login(){
		$User = M("user"); // 实例化User对象
		$map['username&password'] =array('admin','admin','_multi'=>true);// 把查询条件传入查询方法
		$User->where($map)->select(); 
	}
	public function user_reg(){
		
	}
	public function user_add(){
//		if(！isset($_POST)){
//			
//			$fault = M('User');
//			$fault->create();
//			$result = $fault->add();//添加故障信息到故障表
//			
//		}else{
			
			
		if(isset($_POST['submit'])){
			
			$user = M('User');
			$user->create();
			$result = $user->add();//添加故障信息到故障表
			if($result){
				$this->success('用户添加成功了，请重新报障！！','/index.php/Home/',3);
			}else{
				echo '没有添加成功';
			}
			
		}else{
			$user_tel = $_GET['user_tel'];
			$this->assign('user_tel',$user_tel);
			$this->display();
			echo('POST不存在!!!~~~');
		}
			
//		}
		
		
	}
	
}